<template>
  <div class="home">
    <h1>hi</h1>
    <h1>hi,home</h1>
    <h2>路由query传参---{{ $route.query.userName }} --- {{ $route.query.age }}</h2>
    <h2>路由params传参---{{ $route.params.admin }} --- {{ $route.params.passsword }}</h2>
  </div>
</template>

<script>
export default {
  data() {
    return {

    }
  },
  created() {
    // 跳转接收数据
    // this.$route 存储当前组件信息
    console.log(this.$route);
    // 接收query传参
    console.log(this.$route.query.userName);

    // 接收params传参
    console.log(this.$route.params.admin);

  }
}
</script>
